/**
 * 
 */
package trungsi.gea.photos.client

import javax.swing.JFrame;

import groovy.swing.SwingBuilder;

import java.awt.BorderLayout as BL;

/**
 * @author trungsi
 *
 */
class Main2 {
	/**
	 * @param args
	 */
	public static void main(def args) {
		String.metaClass.encodeURL = {
			URLEncoder.encode(delegate, 'UTF-8')
		}
		
		def builder = new SwingBuilder()
        builder.registerBeanFactory 'foldersPanel', FoldersPanel.class
		builder.lookAndFeel(ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel())
        
        def service = new Service(serverUrl : 'http://trung-si-photos.appspot.com')
		
        //def folderPanel = builder.foldersPanel(service : service)
		
        def frame = builder.frame(id : 'mainFrame', title : 'My Photo Client', size : [800, 600], defaultCloseOperation : JFrame.EXIT_ON_CLOSE) {
			panel(constraints : BL.NORTH) {
				label('menu')
			}
			
			panel(id : 'mainPanel') {
				borderLayout()
				foldersPanel(service : service)
			}
		}
		
		frame.show()
	}
}
